// B1TrackingAction.h -- implementation of the class
// derived from G4UserTrackingAction
// Created: Asia SUN, asia.rabbit@163.com, Jan. 20, 2019
// Last modified: Jan. 20, 2019, by Asia SUN

#include "EG4TrackAction.h"
#include "EG4EventAction.h"
#include "G4Track.hh"

EG4TrackAction::EG4TrackAction(EG4EventAction *eventAction)
 : G4UserTrackingAction(), fEventAction(eventAction){}

EG4TrackAction::~EG4TrackAction(){}

void EG4TrackAction::PostUserTrackingAction(const G4Track */*track*/){
  // parentID - 0: primary; 1: secondary; 2: 3rd ...
//  int parentID = track->GetParentID();
//  int trackID = track->GetTrackID();
//  G4VPhysicalVolume *nextVolume = track->GetNextVolume();
//  if(0 == nextVolume && 0 == parentID && 1 == trackID){ // out of the world
//    double ef = track->GetKineticEnergy();
//    eventAction->SetFinalEnergyOfPrimary(ef);
//  }
}
